﻿<UserControl x:Class="ContactTracing.CaseView.Controls.CaseExportOptions"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:p="clr-namespace:ContactTracing.CaseView.Properties"
             xmlns:controls="clr-namespace:ContactTracing.CaseView.Controls"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             Loaded="UserControl_Loaded"
             d:DesignHeight="310" d:DesignWidth="440">
    <Grid>
        <Border BorderBrush="{StaticResource AccentBrush}" BorderThickness="1" Background="{StaticResource LightBackgroundBrush}"
            Padding="20">
            
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.ColumnSpan="4">
                    <Button Style="{StaticResource PanelCloseButtonStyle}"  Click="btnCancel_Click" />
                </StackPanel>

                <StackPanel>
                    <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="1">
                        <Rectangle HorizontalAlignment="Left" Width="100" Height="6" Fill="{StaticResource AccentBrush}" />
                        <TextBlock FontSize="24" Foreground="#444444" FontWeight="Bold" Text="DATA EXPORT OPTIONS" IsHitTestVisible="False" />
                    </StackPanel>

                    <StackPanel Height="14" />

                    <RadioButton x:Name="includeCasesOnly" GroupName="N1" IsChecked="True" Content="Include case data only" />
                    <StackPanel Height="4" />
                    <RadioButton x:Name="includeCasesContacts" GroupName="N1" Content="Include case and contact data" />
                    <!--<StackPanel Height="4" />
                    <RadioButton x:Name="includeContactsOnly" GroupName="N1" Content="Include contact data only" />-->

                    <StackPanel Height="18" />
                    
                    <CheckBox Content="Filter data" IsChecked="False" x:Name="checkboxFilterData" Unchecked="checkboxFilterData_Unchecked" />
                    <StackPanel Height="4" />
                    <Grid IsEnabled="{Binding ElementName=checkboxFilterData, Path=IsChecked}" >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        
                        <TextBlock Grid.Row="0" Grid.Column="1" Text="Case Variable" />
                        
                        <ComboBox x:Name="cmbVariableName1" Width="120" Grid.Row="1" Grid.Column="1" Margin="0, 0, 4, 0">
                            <ComboBoxItem Content="DistrictRes" />
                            <ComboBoxItem Content="DistrictOnset" />
                            <ComboBoxItem Content="SCRes" />
                            <ComboBoxItem Content="SCOnset" />
                            <ComboBoxItem Content="ID" />
                        </ComboBox>
                        <ComboBox x:Name="cmbOperator1" Width="120" Grid.Row="1" Grid.Column="2" SelectedIndex="0" Margin="0, 0, 4, 0">
                            <ComboBoxItem Content="equals" />
                            <ComboBoxItem Content="contains" />
                        </ComboBox>
                        <TextBox x:Name="tboxValue1"  Width="120" Grid.Row="1" Grid.Column="3" Margin="0, 0, 0, 0" />

                        <!--<TextBlock Grid.Row="2" Grid.Column="0" Text="and" Margin="0, 4, 4, 0" />-->
                        <ComboBox x:Name="cmbLogicalOperator" Grid.Row="2" Grid.Column="0" Margin="0, 4, 4, 0" SelectedIndex="0" Width="50">
                            <ComboBoxItem Content="" />
                            <ComboBoxItem Content="and" />
                        </ComboBox>

                        <ComboBox x:Name="cmbVariableName2" Width="120" Grid.Row="2" Grid.Column="1" Margin="0, 4, 4, 0" IsEnabled="{Binding ElementName=cmbLogicalOperator, Path=SelectedIndex, Converter={StaticResource CountToEnabledConverter}}">
                            <ComboBoxItem Content="DistrictRes" />
                            <ComboBoxItem Content="DistrictOnset" />
                            <ComboBoxItem Content="SCRes" />
                            <ComboBoxItem Content="SCOnset" />
                            <ComboBoxItem Content="ID" />
                        </ComboBox>
                        <ComboBox x:Name="cmbOperator2" Width="120" Grid.Row="2" Grid.Column="2" SelectedIndex="0" Margin="0, 4, 4, 0"  IsEnabled="{Binding ElementName=cmbLogicalOperator, Path=SelectedIndex, Converter={StaticResource CountToEnabledConverter}}">
                            <ComboBoxItem Content="equals" />
                            <ComboBoxItem Content="contains" />
                        </ComboBox>
                        <TextBox x:Name="tboxValue2"  Width="120" Grid.Row="2" Grid.Column="3" Margin="0, 4, 0, 0"  IsEnabled="{Binding ElementName=cmbLogicalOperator, Path=SelectedIndex, Converter={StaticResource CountToEnabledConverter}}" />
                    </Grid>
                    
                </StackPanel>

                <UniformGrid Grid.Row="1" VerticalAlignment="Bottom" Rows="1" Columns="4" Width="Auto" Height="28" Margin="0, 15, 0, 0" HorizontalAlignment="Stretch">
                    <TextBlock Grid.Row="0" Grid.Column="0"></TextBlock>
                    <TextBlock Grid.Row="0" Grid.Column="1"></TextBlock>
                    <Button HorizontalAlignment="Stretch" Width="Auto" Grid.Row="0" Grid.Column="2" Margin="0, 0, 5, 0" x:Name="btnOK" Click="btnOK_Click" Content="{x:Static p:Resources.OK}"/>
                    <Button HorizontalAlignment="Stretch" Width="Auto" Grid.Row="0" Grid.Column="3" Margin="5, 0, 0, 0" x:Name="btnCancel" Click="btnCancel_Click" Content="{x:Static p:Resources.Cancel}"/>
                </UniformGrid>
            </Grid>
        </Border>
    </Grid>
</UserControl>
